package com.oxchinx.order.client;

import com.oxchinx.order.dto.CartDTO;
import com.oxchinx.order.model.ProductInfo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * Created by dell on 2018/5/24.
 */
@FeignClient(name="product")
public interface ProductClient {
    @GetMapping("/msg4")
    String productMsg();

    /**
     * 获取商品列表（给订单服务调用）
     */
    @PostMapping("/product/listForOrder")
    public List<ProductInfo>  listForOrder(List<String> productIdList);

    /**
     * 扣库存
     */
    @PostMapping("/product/decreaseStock")
    public void decreaseStock(@RequestBody List<CartDTO> cartDTOList);
}
